int key = 3;

void setup() {
  pinMode(key,OUTPUT);
}

void loop() {
  int i;//定义电压值;
  while(1){
    i = analogRead(0);
    if(i>1000){
      digitalWrite(key, LOW);
    }else{
      digitalWrite(key, HIGH);
    }
  }
}
